<template>
  <div  class="container">
    <More v-for="item of detail" :key="item.id" :data="item" ></More>
  </div>
</template>

<script>
export default {
  data() {
    return {
      detail:[]
    }
  },
  mounted() {
    console.log(this.$route.params);
    var {title}=this.$route.params;
    if(title=="最新音乐"){
       this.$http.get("http://47.108.197.28:3000/album/newest").then((item) => {
      var res = item.data.albums;
      res.forEach(item=>{
        var {picUrl}=item;
        item.img=picUrl
      })
      this.detail=item.data.albums;

    });
    }else if(title=="热门歌单"){
      this.$http.get("http://47.108.197.28:3000/top/playlist/highquality").then((item) => {
        item.data.playlists.forEach(item=>{
          var {coverImgUrl}=item;
          item.img=coverImgUrl;
        })
        this.detail =item.data.playlists
              console.log(this.detail);
      });
    }else if(title=="主播电台"){
      this.$http.get("http://47.108.197.28:3000/personalized/djprogram ").then((list) => {
        // console.log(list);
        list.data.result.forEach(item=>{
          var {picUrl}=item;
          item.img=picUrl
        })
        this.detail = list.data.result
      });
    }
  },
}
</script>

<style>
  .container{
    display: flex;
    flex-wrap: wrap;
    justify-content: space-between;
}
</style>